New file collecting the type constants, includes and the union for the
authorMartin Nordholts <martinn@src.gnome.org>
Sun, 18 Jan 2009 13:33:52 +0000 (13:33 +0000)
committerMartin Nordholts <martinn@src.gnome.org>
Sun, 18 Jan 2009 13:33:52 +0000 (13:33 +0000)
* babl/babl-classes.h: New file collecting the type constants,
includes and the union for the babl classes. When adding a new
class this is the only installed header file that requires
modification.

* babl/babl-class.h: Move the class type enums to the new file.

* babl/babl.h: Include babl-classes.h instead of each class on its
own, and move the Babl union to the new file.

* babl/Makefile.am: Add the new file.

svn path=/trunk/; revision=385

ChangeLog
babl/Makefile.am
babl/babl-class.h
babl/babl-classes.h [new file with mode: 0644]
babl/babl.h

index 320da45eb12f895f93e39442e83eab58f56744c5..fd8802033ca113a835cfeae4a2fcfd8df9025eb3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2009-01-18  Martin Nordholts  <martinn@svn.gnome.org>
+
+       * babl/babl-classes.h: New file collecting the type constants,
+       includes and the union for the babl classes. When adding a new
+       class this is the only installed header file that requires
+       modification.
+
+       * babl/babl-class.h: Move the class type enums to the new file.
+
+       * babl/babl.h: Include babl-classes.h instead of each class on its
+       own, and move the Babl union to the new file.
+
+       * babl/Makefile.am: Add the new file.
+
 2009-01-18  Sven Neumann  <sven@gimp.org>
 
        * babl/babl-component.h
index 40479dfc9564876cad343e3da27992751cea411b..039e75623912a2cbfa60b45fd86f4bdbdb29f0b4 100644 (file)
@@ -35,6 +35,7 @@ c_sources =                           \
 
 h_sources  =                           \
        babl-class.h                    \
+       babl-classes.h                  \
        babl-db.h                       \
        babl-ids.h                      \
        babl-internal.h                 \
@@ -52,6 +53,7 @@ library_includedir=$(includedir)/babl-$(BABL_API_VERSION)/babl
 library_include_HEADERS =              \
        babl.h                          \
        babl-class.h                    \
+       babl-classes.h                  \
        babl-component.h                \
        babl-conversion.h               \
        babl-extension.h                \
index 65a0a357c9f4e673d36b73d342005325f0e76009..811dff7eae30f9642f86c10939606c12dbc7f065 100644 (file)
 #error  this file is only to be included by babl.h
 #endif
 
-
-/* magic number used at the start of all babl objects, used to do
- * differentiation in polymorphic functions. (as well as manual
- * type check assertions).
- */
-#define BABL_MAGIC   0xbab100
-
-enum {
-  BABL_INSTANCE = BABL_MAGIC,
-  BABL_TYPE,
-  BABL_TYPE_INTEGER,
-  BABL_TYPE_FLOAT,
-  BABL_SAMPLING,
-  BABL_COMPONENT,
-  BABL_MODEL,
-  BABL_FORMAT,
-
-  BABL_CONVERSION,
-  BABL_CONVERSION_LINEAR,
-  BABL_CONVERSION_PLANE,
-  BABL_CONVERSION_PLANAR,
-
-  BABL_FISH,
-  BABL_FISH_REFERENCE,
-  BABL_FISH_SIMPLE,
-  BABL_FISH_PATH,
-  BABL_IMAGE,
-
-  BABL_EXTENSION,
-
-  BABL_SKY
-};
 typedef int BablClassType;
 
 typedef union _Babl Babl;
diff --git a/babl/babl-classes.h b/babl/babl-classes.h
new file mode 100644 (file)
index 0000000..84b694c
--- /dev/null
@@ -0,0 +1,94 @@
+/* babl - dynamically extendable universal pixel conversion library.
+ * Copyright (C) 2005-2008, Øyvind Kolås and others.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _BABL_CLASSES_H
+#define _BABL_CLASSES_H
+
+#ifndef _BABL_H
+#error  this file is only to be included by babl.h
+#endif
+
+
+/* magic number used at the start of all babl objects, used to do
+ * differentiation in polymorphic functions. (as well as manual type
+ * check assertions).
+ */
+#define BABL_MAGIC   0xbab100
+
+/* class types */
+enum {
+  BABL_INSTANCE = BABL_MAGIC,
+  BABL_TYPE,
+  BABL_TYPE_INTEGER,
+  BABL_TYPE_FLOAT,
+  BABL_SAMPLING,
+  BABL_COMPONENT,
+  BABL_MODEL,
+  BABL_FORMAT,
+
+  BABL_CONVERSION,
+  BABL_CONVERSION_LINEAR,
+  BABL_CONVERSION_PLANE,
+  BABL_CONVERSION_PLANAR,
+
+  BABL_FISH,
+  BABL_FISH_REFERENCE,
+  BABL_FISH_SIMPLE,
+  BABL_FISH_PATH,
+  BABL_IMAGE,
+
+  BABL_EXTENSION,
+
+  BABL_SKY
+};
+
+
+#include "babl-type.h"
+#include "babl-sampling.h"
+#include "babl-component.h"
+#include "babl-model.h"
+#include "babl-format.h"
+#include "babl-image.h"
+#include "babl-conversion.h"
+#include "babl-fish.h"
+#include "babl-extension.h"
+
+
+/* This union can be used for convenient access to any field without
+ * the need to case if the variable already is of the type Babl*
+ */
+typedef union _Babl
+{
+  BablClassType     class_type;
+  BablInstance      instance;
+  BablType          type;
+  BablSampling      sampling;
+  BablComponent     component;
+  BablModel         model;
+  BablFormat        format;
+  BablConversion    conversion;
+  BablImage         image;
+  BablFish          fish;
+  BablFishReference fish_reference;
+  BablFishSimple    fish_simple;
+  BablFishPath      fish_path;
+  BablExtension     extension;
+} _Babl;
+
+
+#endif
index 17fa219b6b91805bfb0a349f3498e4e2b538ac2a..f953c1cb49d266eb180cba787d289b34d1eafa26 100644 (file)
@@ -28,6 +28,7 @@
 #error babl.h included after babl-internal.h
 #endif
 
+
 typedef struct _BablList BablList;
 
 #include "babl-macros.h"
@@ -35,35 +36,7 @@ typedef struct _BablList BablList;
 #include "babl-class.h"
 #include "babl-introspect.h"
 #include "babl-version.h"
-#include "babl-type.h"
-#include "babl-sampling.h"
-#include "babl-component.h"
-#include "babl-model.h"
-#include "babl-format.h"
-#include "babl-image.h"
-#include "babl-conversion.h"
-#include "babl-fish.h"
-#include "babl-extension.h"
+#include "babl-classes.h"
 
-/* This union can be used for convenient access to any field without the need
- * to case if the variable already is of the type Babl *
- */
-typedef union _Babl
-{
-  BablClassType     class_type;
-  BablInstance      instance;
-  BablType          type;
-  BablSampling      sampling;
-  BablComponent     component;
-  BablModel         model;
-  BablFormat        format;
-  BablConversion    conversion;
-  BablImage         image;
-  BablFish          fish;
-  BablFishReference fish_reference;
-  BablFishSimple    fish_simple;
-  BablFishPath      fish_path;
-  BablExtension     extension;
-} _Babl;
 
 #endif